local SettingController = {}
local helper = require 'library.helpers'

function SettingController:index()
	local config = require ('library.config'):new()
	local p = {
		config=config:get_default()
	}

	return self:display(p)
end

function SettingController:store()
	local config = require ('library.config'):new()
	local post=self:getRequest():POST()

	for i,v in pairs(post) do
		config:set(i,v)
	end

	config:save()
	
	return helper:show_msg(0,"保存成功",{url=helper:url('admin/setting/index')})

end

return SettingController
